const tags ={
    name: "projectionHall",
    description: "放映厅管理模块",
};

const schemas = {
    projectionHall: {
        properties: {
            _id: {
                type: "string",
                description: "唯一标识",
            },
            name: {
                type: "string",
                description: "放映厅名",
            },
            status: {
                type: "boolean",
                description: "营业状态",
            },
            cinemasId: {
                type: "string",
                description: "所属影院",
            },
            
        },
    },
    // 设置放映厅data属性
    ArrayOfProjectionHall: {
        properties: {
            total: {
                type: "number",
                description: "总数",
            },
            maxPage: {
                type: "number",
                description: "总页数",
            },
            rows: {
                type: "array",
                description: "放映厅",
                items: {
                    $ref: "#/components/schemas/projectionHall",
                },
            },
        },
    },
};

const paths = {
    "/projectionHall": {
        get: {
            tags: ["projectionHall"],
            summary: "获取放映厅信息",
            description: "",
            consumes: ["application/json"],
            // 参数
            parameters: [
                {
                    name: "curPage",
                    in: "query",
                    schema: {
                        type: "integer",
                        default: 1,
                    },
                    required: true,
                    description: "当前页码",
                },
                {
                    name: "eachPage",
                    in: "query",
                    schema: {
                        type: "integer",
                        default: 1,
                    },
                    required: true,
                    description: "每页条数",
                },
            ],
            responses: {
                200: {
                    description: "操作成功",
                    content: {
                        "application/json": {
                            schema: {
                                $ref: "#/components/schemas/ArrayOfprojectionHall",
                            },
                        },
                    },
                },
                404: {
                    description: "找不到资源",
                },
            },
        },
    },
    "/projectionHall/add": {
        post: {
            tags: ["projectionHall"],
            summary: "新增放映厅信息",
            description: "",
            // 请求参数
            requestBody: {
                // 必填
                required: true,
                // 内容
                content: {
                    "application/json": {
                        // 结构
                        schema: {
                            $ref: "#/components/schemas/projectionHall",
                        },
                        example: {
                            name: "1号放映厅",
                            status: true,
                            cinemasId: "万达影城",
                        },
                    },
                },
            },
            responses: {
                200: {
                    description: "操作成功",
                    content: {
                        "application/json": {
                            schema: {
                                $ref: "#/components/schemas/ArrayOfprojectionHall",
                            },
                        },
                    },
                },
                404: {
                    description: "找不到资源",
                },
            },
        },
    },
    "/projectionHall/reset": {
        patch: {
            tags: ["projectionHall"],
            summary: "修改放映厅信息",
            description: "",
            // 请求参数
            requestBody: {
                // 必填
                required: true,
                // 内容
                content: {
                    "application/json": {
                        // 结构
                        schema: {
                            $ref: "#/components/schemas/projectionHall",
                        },
                        example: {
                            name: "1号放映厅",
                            status: true,
                            cinemasId: "万达影城",
                        },
                    },
                },
            },
            responses: {
                200: {
                    description: "操作成功",
                    content: {
                        "application/json": {
                            schema: {
                                $ref: "#/components/schemas/ArrayOfprojectionHall",
                            },
                        },
                    },
                },
                404: {
                    description: "找不到资源",
                },
            },
        },
    },
    "/projectionHall/del/{_id}": {
        delete: {
            tags: ["projectionHall"],
            summary: "删除放映厅信息",
            description: "",
            // 请求参数
            requestBody: {
                // 必填
                required: true,
                // 内容
                content: {
                    "application/json": {
                        // 结构
                        schema: {
                            $ref: "#/components/schemas/projectionHall",
                        },
                        example: {
                            name: "1号放映厅",
                            status: true,
                            cinemasId: "万达影城",
                        },
                    },
                },
            },
            responses: {
                200: {
                    description: "操作成功",
                    content: {
                        "application/json": {
                            schema: {
                                $ref: "#/components/schemas/ArrayOfprojectionHall",
                            },
                        },
                    },
                },
                404: {
                    description: "找不到资源",
                },
            },
        },
    },
};

module.exports = { tags, schemas, paths }